import axios from "axios"

export default options =>{
    return{
        data() {
            return {
                
            }
        },
        methods: {
            $get(url,params){
                options.log && console.log(`get请求了${url}`)
                return axios.get(url,{
                    params
                })
            },
            $post(url,params){
                options.log && console.log(`post请求了${url}`)
                return axios.post(url,params)
            },
            $ms(content,OnClose,duration = 1){
                return this.$message.success(content,onclose,duration)
            },
            $me(content,OnClose,duration = 1){
                return this.$message.error(content,onclose,duration)
            },
            $mw(content,OnClose,duration = 1){
                return this.$message.warning(content,onclose,duration)
            },
        },
    }
   
}